package com.ruoyi.modules.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.modules.domain.AgentLevel;
import com.ruoyi.modules.domain.vo.AppDyAgentUserVo;
import com.ruoyi.modules.service.INumRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import com.ruoyi.modules.mapper.DyAgentUserMapper;
import com.ruoyi.modules.domain.DyAgentUser;
import com.ruoyi.modules.service.IDyAgentUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 代理Service业务层处理
 *
 * @author ruoyi
 * @date 2022-01-22
 */
@Service
public class DyAgentUserServiceImpl extends ServiceImpl<DyAgentUserMapper, DyAgentUser> implements IDyAgentUserService {

    @Lazy
    @Autowired
    private INumRecordService numRecordService;

    @Override
    public AppDyAgentUserVo getAppDyAgentUserVo(Long agentUserId) {
        AppDyAgentUserVo appDyAgentUserVo = baseMapper.getAppDyAgentUserVo(agentUserId);
        //今天的已经免费的次数
        Long todayFreeNum = numRecordService.getTodayFreeNum(agentUserId);
        appDyAgentUserVo.setTodayFreeNum(todayFreeNum);
        return appDyAgentUserVo;
    }
}
